# Contributor: Marian Buschsieweke <marian.buschsieweke@posteo.net>
# Maintainer: Marian Buschsieweke <marian.buschsieweke@posteo.net>
pkgname=git-absorb
pkgver=0.6.11
pkgrel=1
pkgdesc="Automatically write fixup! commits, similar to hg absort"
url="https://github.com/tummychow/git-absorb"
license="BSD-3-Clause"
arch="all"
makedepends="
	cargo
	cargo-auditable
	libgit2-dev
	"
subpackages="$pkgname-doc"
options="net"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/tummychow/git-absorb/archive/refs/tags/$pkgver.tar.gz
	0001-update-libc-crate.patch
	0002-fix-build-on-riscv64.patch
	"

prepare() {
	default_prepare
	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

check() {
	cargo test --frozen
}

package() {
	install -Dm755 --target-directory="$pkgdir"/usr/bin target/release/git-absorb
	install -Dm644 --target-directory="$pkgdir"/usr/share/man/man1 Documentation/git-absorb.1
}

sha512sums="
fd0df4fe6ec549cd65592a2ee81b9cdbec56063b71bee22311cc3044c3c0ff3b35f3c64b73edc2eb2b27fe2f9ddf75ae9025b265642e3292fd1b1804facdcfaa  git-absorb-0.6.11.tar.gz
223b8168b234c35ad7a6ec86a9fd3ed11256368f246434de7dd1ecbdce04a28f478313c8c49adf7e32a0352f59af2410d61d21c0a12f3d0e9dac8cc1a530aaee  0001-update-libc-crate.patch
f8b55f8f7869dd3f1ebfd9de97055855266171a08de6c0ea801c8b59209228fe990463a46a627dd75ce3c0da1eb95ef2b2f2f8a86193b77641a944d366968060  0002-fix-build-on-riscv64.patch
"
